with open("demo1.txt", "w") as f:
    for i in range(5):
        print("input the %d line:" % (i + 1))
        str = input()
        f.writelines((str) + "\n")
